<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
<f:view>
	<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
	<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
	<title>Untitled Document</title>
	<link href="css/style.css" media="all" type="text/css" rel="stylesheet" />
	<script type="text/javascript" src="js/index.js"></script>
	<script type="text/javascript" src="js/jquery-1.3.2.js"></script>
	</head>

	<body onload="javascript: iniciaComet2();">

	<div id="centralizer">


	<div id="home" class="content">
	<div class="category_box">
	<h3>Categorias</h3>

	<h:dataTable value="#{categoriaBean.categorias}" var="categoria">
		<h:column>
			<f:facet name="header">
				<h:outputText value="Nome"></h:outputText>
			</f:facet>
			<h:outputText value="#{categoria.nome}" />
		</h:column>

		<h:column>
			<f:facet name="header">
				<h:outputText value="Lista"></h:outputText>
			</f:facet>
			<h:form>
				<h:commandLink actionListener="#{categoriaBean.escolheCategoria}" value="lista">
					<f:param value="#{categoria.id}" name="categoriaID"
						id="categoriaID" />
				</h:commandLink>
			</h:form>
		</h:column>

	</h:dataTable></div>

	<div class="search_box"><h:form>

		<h3>Buscar uma Pergunta</h3>
		<div class="dashed_separator"></div>
		<h:inputText value="#{perguntaBean.titulo}"></h:inputText>
		<h:inputHidden value="#{perguntaBean.categoriaId}"></h:inputHidden>
		<h:commandButton action="#{perguntaBean.busca}"></h:commandButton>

	</h:form></div>

	<div class="question_list_box">
	<h3>Resultados da Busca</h3>
	<div class="dashed_separator"></div>
	<ul>
		<h:dataTable value="#{perguntaBean.perguntas}" var="loc">
			<h:column>
				<f:facet name="header">
					<h:outputText value="Titulo"></h:outputText>
				</f:facet>
				<h:outputText value="#{loc.titulo}" />

				<f:facet name="footer">
					<h:outputText value="Titulo"></h:outputText>
				</f:facet>
			</h:column>
			<h:column>
				<f:facet name="header">
					<h:outputText value="Positivo"></h:outputText>
				</f:facet>
				<h:outputText value="#{loc.votoPositivo}" />

				<f:facet name="footer">
					<h:outputText value="Positivo"></h:outputText>
				</f:facet>
			</h:column>
			<h:column>
				<f:facet name="header">
					<h:outputText value="Negativo"></h:outputText>
				</f:facet>
				<h:outputText value="#{loc.votoNegativo}" />

				<f:facet name="footer">
					<h:outputText value="Negativo"></h:outputText>
				</f:facet>
			</h:column>
			<h:column>
				<f:facet name="header">
					<h:outputText value="Total"></h:outputText>
				</f:facet>
				<h:outputText value="#{loc.votoPositivo+loc.votoNegativo}" />

				<f:facet name="footer">
					<h:outputText value="Total"></h:outputText>
				</f:facet>
			</h:column>
		</h:dataTable>
	</ul>
	</div>

	<div class="cleaner"></div>
	</div>

	<div class="footer"></div>
	</div>

	</body>
	</html>
</f:view>